#!/usr/bin/perl

$num = int(1+rand 100);
print "num is $num\n";

while (1) {
print "enter number from 1 to 100\n";
$hum = <STDIN>;
  if ($num == $hum) {
  print "you win\n";
  last;
  } 
  elsif ($hum =~ /exit|quit/i) {
  last; 
  }
  elsif ($hum < $num) {
  print "too low\n";
  } elsif ($hum > $num) {
  print "too high\n";
  }
}

